#include <iostream>
#include <string>
#include <unordered_map>
//
// Created by lingzhitech on 25-9-30.
//
int main() {
    // count occurrences, but the words won't be in alphabetical order
    std::unordered_map<std::string, size_t> word_count;
    std::string word;
    while (std::cin >> word)
        ++word_count[word]; // fetch and increment the counter for word
    for (const auto &w: word_count) // for each element in the map
        // print the results
        std::cout << w.first << " occurs " << w.second
                << ((w.second > 1) ? " times" : " time") << std::endl;
}
